package com.ye.personnel.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.stream.Stream;

/**
 * @Author: yeubo
 * @Date: 2024/1/2 17:13
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum UserTypeEnum {

    SZ(0,"市直单位"),
    KLC(1,"公务员考录处"),
    XXC(2,"信息管理处"),
    GZC(3,"工资处"),
    ZHC(4,"公务员综合处"),
    GBC(5,"干部监督处");

    public Integer type;
    public String name;

    public static String getName(Integer type){
        UserTypeEnum userTypeEnum = Stream.of(values())
                .filter(t -> t.type.equals(type))
                .findFirst()
                .orElse(SZ);
        return userTypeEnum.getName();
    }
}
